/*
 * @Author: your name
 * @Date: 2021-10-04 10:25:37
 * @LastEditTime: 2021-10-05 18:55:34
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \diff\src\index.js
 */

import { h } from './mysnabbdom/h'
import patch from './mysnabbdom/patch';
import vnode from './mysnabbdom/vnode';
const ctx = document.getElementsByClassName('container')[0];
const vnodes = h('ul',{},[
  h('li',{key:'A'},'A'),
  h('li',{key:'B'},'B'),
  h('li',{key:'C'},'C'),
  h('li',{key:'D'},'D'),
  h('li',{key:'E'},'E'),
])

patch(ctx,vnodes);
const vnodes2 = h('ul',{},[
  h('li',{key:'A'},'A'),
  h('li',{key:'B'},'B阿萨大'),
  h('li',{key:'C'},'C'),
  h('li',{key:'D'},'D'),
  h('li',{key:'E'},'E'),
])
// h函数 由于参数自定义 所以第一阶段使用方法重载判断
let btns = document.getElementsByClassName('btns')[0];
btns.onclick = ()=>{
  patch(vnodes,vnodes2);
}

